package com.yang.sms.service.impl;

import com.baomidou.mybatisplus.service.impl.ServiceImpl;
import com.yang.sms.entity.SmsTaskDetail;
import com.yang.sms.enums.SmsTaskDetailEnum;
import com.yang.sms.mapper.SmsTaskDetailMapper;
import com.yang.sms.service.SmsTaskDetailService;
import org.springframework.stereotype.Service;

import java.util.List;

/**
* @author Billyang
* @description 针对表【sms_task_detail(短信发送任务明细)】的数据库操作Service实现
* @createDate 2024-09-26 17:56:28
*/
@Service
public class SmsTaskDetailServiceImpl extends ServiceImpl<SmsTaskDetailMapper, SmsTaskDetail>
    implements SmsTaskDetailService {
    @Override
    public Integer updateStatusByStatus(SmsTaskDetailEnum.Status toStatus, String remark, Integer id,
                                        SmsTaskDetailEnum.Status fromStatus) {
        return baseMapper.updateStatusByStatus(toStatus, remark, id, fromStatus);
    }

    public Integer updateContentById(String content, Integer id) {
        return baseMapper.updateContentById(content, id);
    }

    public Integer updateSendSuccessStatus(SmsTaskDetailEnum.Status toStatus, String remark, Integer id) {
        return baseMapper.updateSendSuccessStatus(toStatus, remark, id);
    }

    public Integer updateStatusRemark(SmsTaskDetailEnum.Status toStatus, String remark, Integer id) {
        return baseMapper.updateStatusRemark(toStatus, remark, id);
    }

    public Integer updateRemark(String remark, Integer id) {
        return baseMapper.updateRemark(remark, id);
    }

    @Override
    public List<Integer> select4PreTimeSend(SmsTaskDetailEnum.Status status, int limit) {
        return baseMapper.select4PreTimeSend(status, limit);
    }
}




